<script type="text/javascript" src="__PUBLIC__/js/plupload/plupload.full.min.js"></script>
<script type="text/javascript">
    var uploader = new plupload.Uploader({
        runtimes: 'html5,flash,silverlight,html4',
        browse_button: 'logo_upload_btn', // you can pass in id...
        logo_area_tr: document.getElementById('logo_area_tr'), // ... or DOM Element itself
        url: "{:U('Upload/logo')}",
        flash_swf_url: '__PUBLIC__/js/plupload/Moxie.swf',
        silverlight_xap_url: '__PUBLIC__/js/plupload/Moxie.xap',
        filters: {
            max_file_size: '25mb',
            mime_types: [
                {title: "files", extensions: "jpg,png,gif,jpeg"}
            ]
        },
        multi_selection: false,
        init: {
            FilesAdded: function(up, files) {
                var div = '';
                plupload.each(files, function(file) {
                    div += "<img src='__PUBLIC__/images/loading.gif' class='loading'>";
                });
                document.getElementById('logo_upload_area').innerHTML += div;
                uploader.start();
            },
            FileUploaded: function(up, file, info) {
                //     console.log(info.response)
                var data = eval("(" + info.response + ")");
                var src = data.src;
                var logo_upload_area = "<img src='" + src + "' style='max-width: 300px;max-height: 300px;'/>";
                $("#logo_upload_area").html(logo_upload_area);
                $("#logo").val(data.name);
                $('#logo-error').remove();
                        },
            Error: function(up, err) {
                if (err.code == -601) {
                    alert("请上传jpg,png,gif或jpeg！");
                }
            }
        }
    });
    uploader.init();
    var uploader2 = new plupload.Uploader({
        runtimes: 'html5,flash,silverlight,html4',
        browse_button: 'zip_upload_btn', // you can pass in id...
        zip_area_tr: document.getElementById('zip_area_tr'), // ... or DOM Element itself
        url: "{:U('Upload/zip_Js')}",
        flash_swf_url: '__PUBLIC__/js/plupload/Moxie.swf',
        silverlight_xap_url: '__PUBLIC__/js/plupload/Moxie.xap',
        filters: {
            max_file_size: '50mb',
            mime_types: [
                {title: "files", extensions: "zip,rar"}
            ]
        },
        multi_selection: false,
        init: {
            FilesAdded: function(up, files) {
                var div = '';
                plupload.each(files, function(file) {
                    div += "<div class='progress' id='progress_zip' data-percent='0%'>\n\
<div class='progress-bar' style='width:0%;'></div></div>";
                });
                document.getElementById('zip_upload_area').innerHTML += div;
                uploader2.start();
            },
            UploadProgress: function(up, file) {
                uploader2.bind('UploadProgress', function(up, file) {
                    $('#progress_zip').find('.progress-bar').css({"width": file.percent + "%"})
                    $('#progress_zip').attr("data-percent", file.percent + "%")
                });
            },
            FileUploaded: function(up, file, info) {
                //     console.log(info.response)
                var data = eval("(" + info.response + ")");
                var zip_show_area = "<a href='__APP__/" + data.url + "'>" + data.name + "</a>";
                $("#progress_zip").remove();
                $("#zip_show_area").html(zip_show_area);
                $("#files_save").val(data.name);
                 $('#files_save-error').remove();
                        },
            Error: function(up, err) {
                alert(err.code);
                if (err.code == -601) {
                    alert("请上传zip或rar压缩文件！");
                }if (err.code == -600) {
                    alert("压缩文件大小不能超过50mb！");
                }
            }
        }
    });
    uploader2.init();
</script>